package cn.iocoder.yudao.module.cmt.dal.mysql.content;

import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.cmt.dal.dataobject.content.ContentResourceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.cmt.controller.admin.content.vo.*;

@Mapper
public interface ContentResourceMapper extends BaseMapperX<ContentResourceDO> {

    default PageResult<ContentResourceDO> selectPage(ContentResourcePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ContentResourceDO>()
                .betweenIfPresent(ContentResourceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ContentResourceDO::getId));
    }

}
